home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / LINUX / CONSOLE.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  3KB  |  115 lines

  1. /*
  2.  *  linux/include/linux/console.h
  3.  *
  4.  *  Copyright (C) 1993        Hamish Macdonald
  5.  *
  6.  * This file is subject to the terms and conditions of the GNU General Public
  7.  * License.  See the file COPYING in the main directory of this archive
  8.  * for more details.
  9.  *
  10.  * Changed:
  11.  * 10-Mar-94: Arno Griffioen: Conversion for vt100 emulator port from PC LINUX
  12.  */
  13.  
  14. #ifndef _LINUX_CONSOLE_H_
  15. #define _LINUX_CONSOLE_H_ 1
  16.  
  17. struct vc_data;
  18. struct console_font_op;
  19.  
  20. /*
  21.  * this is what the terminal answers to a ESC-Z or csi0c query.
  22.  */
  23. #define VT100ID "\033[?1;2c"
  24. #define VT102ID "\033[?6c"
  25.  
  26. struct consw {
  27.     const char *(*con_startup)(void);
  28.     void    (*con_init)(struct vc_data *, int);
  29.     void    (*con_deinit)(struct vc_data *);
  30.     void    (*con_clear)(struct vc_data *, int, int, int, int);
  31.     void    (*con_putc)(struct vc_data *, int, int, int);
  32.     void    (*con_putcs)(struct vc_data *, const unsigned short *, int, int, int);
  33.     void    (*con_cursor)(struct vc_data *, int);
  34.     int    (*con_scroll)(struct vc_data *, int, int, int, int);
  35.     void    (*con_bmove)(struct vc_data *, int, int, int, int, int, int);
  36.     int    (*con_switch)(struct vc_data *);
  37.     int    (*con_blank)(struct vc_data *, int);
  38.     int    (*con_font_op)(struct vc_data *, struct console_font_op *);
  39.     int    (*con_set_palette)(struct vc_data *, unsigned char *);
  40.     int    (*con_scrolldelta)(struct vc_data *, int);
  41.     int    (*con_set_origin)(struct vc_data *);
  42.     void    (*con_save_screen)(struct vc_data *);
  43.     u8    (*con_build_attr)(struct vc_data *, u8, u8, u8, u8, u8);
  44.     void    (*con_invert_region)(struct vc_data *, u16 *, int);
  45.     u16    *(*con_screen_pos)(struct vc_data *, int);
  46.     unsigned long (*con_getxy)(struct vc_data *, unsigned long, int *, int *);
  47. };
  48.  
  49. extern struct consw *conswitchp;
  50.  
  51. extern struct consw dummy_con;    /* dummy console buffer */
  52. extern struct consw fb_con;    /* frame buffer based console */
  53. extern struct consw vga_con;    /* VGA text console */
  54. extern struct consw prom_con;    /* SPARC PROM console */
  55.  
  56. void take_over_console(struct consw *sw, int first, int last, int deflt);
  57. void give_up_console(struct consw *sw);
  58.  
  59. /* scroll */
  60. #define SM_UP       (1)
  61. #define SM_DOWN     (2)
  62.  
  63. /* cursor */
  64. #define CM_DRAW     (1)
  65. #define CM_ERASE    (2)
  66. #define CM_MOVE     (3)
  67.  
  68. /*
  69.  *    Array of consoles built from command line options (console=)
  70.  */
  71. struct console_cmdline
  72. {
  73.     char    name[8];            /* Name of the driver        */
  74.     int    index;                /* Minor dev. to use        */
  75.     char    *options;            /* Options for the driver   */
  76. };
  77. #define MAX_CMDLINECONSOLES 8
  78. extern struct console_cmdline console_list[MAX_CMDLINECONSOLES];
  79.  
  80. /*
  81.  *    The interface for a console, or any other device that
  82.  *    wants to capture console messages (printer driver?)
  83.  */
  84.  
  85. #define CON_PRINTBUFFER    (1)
  86. #define CON_CONSDEV    (2) /* Last on the command line */
  87. #define CON_ENABLED    (4)
  88.  
  89. struct console
  90. {
  91.     char    name[8];
  92.     void    (*write)(struct console *, const char *, unsigned);
  93.     int    (*read)(struct console *, const char *, unsigned);
  94.     kdev_t    (*device)(struct console *);
  95.     int    (*wait_key)(struct console *);
  96.     void    (*unblank)(void);
  97.     int    (*setup)(struct console *, char *);
  98.     short    flags;
  99.     short    index;
  100.     int    cflag;
  101.     struct     console *next;
  102. };
  103.  
  104. extern void register_console(struct console *);
  105. extern int unregister_console(struct console *);
  106. extern struct console *console_drivers;
  107.  
  108. /* VESA Blanking Levels */
  109. #define VESA_NO_BLANKING        0
  110. #define VESA_VSYNC_SUSPEND      1
  111. #define VESA_HSYNC_SUSPEND      2
  112. #define VESA_POWERDOWN          3
  113.  
  114. #endif /* _LINUX_CONSOLE_H */
  115.